<%@ page contentType="text/html; charset=UTF-8" %>
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@ page import="com.wlcorp.forcazamis.domain.storageassign.StorageAssign" %>
<%@ page import="com.wlcorp.forcazamis.sys.util.CommonUtil" %>
<%@ page import="com.wlcorp.forcazamis.domain.confirm.ConfirmDetail" %>
<%@ page import="com.wlcorp.forcazamis.sys.util.AppConstant" %>
<%@ page import="com.wlcorp.forcazamis.sys.permission.PermissionManager" %>
<%
	List storageAssignList = (List)request.getAttribute("storageAssignList");
%>
<html>
<head>
	<title>样品调拨单列表</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-Control" content="no-cache"><meta http-equiv="Expires" content="0">
	<link href="${pageContext.request.contextPath}/css/css.css" rel=stylesheet>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/button_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/form_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/table_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/pagetitle_css.css" type="text/css">
	<script language="javascript" src="${pageContext.request.contextPath}/script/common.js"></script>
	<script type="text/javascript">
    	function storageAssignBaseInfo(storageAssignId){
    		parent.location = "${pageContext.request.contextPath}/storageassign/storageAssignManager.do?method=getStorageAssign&storageAssignId=" + storageAssignId;
    	}
    	function deleteRecord(storageAssignId){
    		if(confirm("确定删除？")){
    			window.location = "${pageContext.request.contextPath}/storageassign/storageAssignManager.do?method=deleteStorageAssign&storageAssignId=" + storageAssignId;
    		}
    	}
    	function storageDetail(storageAssignId){
			parent.location = "${pageContext.request.contextPath}/storageassign/storageAssignManager.do?method=getStorageAssignDetail&storageAssignId=" + storageAssignId;
		}
		
		function printStorageAssign(storageAssignId){
			window.open("${pageContext.request.contextPath}/storageassign/storageAssignManager.do?method=printStorageAssign&storageAssignId=" + storageAssignId);
		}
    </script>
</head>
<body bgcolor="#ffffff">
  <center>
	<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#999999">
          <tr bgcolor="#E7E7E7">
            <td class="bigtext" align="center" width="5%">序号</td>
            <td class="bigtext" align="center">调出仓库</td>
            <td class="bigtext" align="center">操作人</td>
            <td class="bigtext" align="center">调出时间</td>
            <td class="bigtext" align="center">调入仓库</td>
            <td class="bigtext" align="center">接收人</td>
            <td class="bigtext" align="center">审批时间</td>
            <td class="bigtext" align="center">状态</td>
            <td class="bigtext" align="center">备注</td>
            <td class="bigtext" align="center">操作</td>
          </tr>
          <% 
          	int index = 0;
          	for(Iterator iter = storageAssignList.iterator();iter.hasNext();){
          		StorageAssign storageAssign = (StorageAssign)iter.next();
          		index++;
          %>
          <tr bgcolor="#ffffff" onmouseover="this.style.backgroundColor='#bbdffb';" onmouseout="this.style.backgroundColor='#ffffff'">
            <td align="center" class="td5px"><%=index%></td>
            <td class="td5px"><%=storageAssign.getAssignFromDepot().getDepotName()%></td>
            <td class="td5px"><%=storageAssign.getSubmiter().getStaffName()%></td>
            <td class="td5px"><%=storageAssign.getAssignDate()%></td>
            <td class="td5px"><%=storageAssign.getAssignToDepot().getDepotName()%></td>
            <td class="td5px"><%=storageAssign.getAssignToStaff().getStaffName()%></td>
            <td class="td5px"><%if(null != storageAssign.getConfirm()){out.print(((ConfirmDetail)storageAssign.getConfirm().getConfirmDetailSet().iterator().next()).getConfirmDate());}%></td>
            <td class="td5px"><%=storageAssign.getStateName()%></td>
            <td class="td5px"><%=CommonUtil.nullToStr(storageAssign.getMemo())%></td>
            <td align="center" class="td5px"><a href="javascript:storageAssignBaseInfo('<%=storageAssign.getStorageAssignId()%>')">查看</a>&nbsp;
            <%if(AppConstant.ASSIGN_STATE_SUBMITED == storageAssign.getState()){%>
            <a id="deleteA" href="javascript:deleteRecord('<%=storageAssign.getStorageAssignId()%>')">删除</a>
            <%}%>
            </td>
		  </tr>
          <%}%>
          <tr bgcolor="#ffffff" onmouseover="this.style.backgroundColor='#bbdffb';" onmouseout="this.style.backgroundColor='#ffffff'">
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td align="center" class="td5px"><a href="javascript:storageAssignBaseInfo('')">新增</a></td>
		  </tr>
	</table>
	<table><tr><td><%=request.getAttribute("pageURL")%></td></tr></table>
  </center>
  <%out.print(PermissionManager.getInstance().checkSubPermission("3004",request));%>
  ${message}
</body>
</html>
